import { request } from './request'

// 获取所有图谱数据
export const getAllGraphData = () => {
  return request.get('/graph/list')
}

// 根据ID获取图谱数据
export const getGraphDataById = (id) => {
  return request.get(`/graph/${id}`)
}

// 根据科目ID获取图谱数据
export const getGraphDataBySubjectId = (subjectId) => {
  return request.get(`/graph/subject/${subjectId}`)
}

// 添加图谱数据
export const addGraphData = (graphData) => {
  return request.post('/graph/add', graphData,{
    'Content-Type': 'application/json'
  })
}

// 批量添加图谱数据
export const batchAddGraphData = (graphDataList) => {
  return request.post('/graph/batch/add', graphDataList)
}

// 更新图谱数据
export const updateGraphData = (graphData) => {
  return request.put('/graph/update', graphData)
}

// 删除图谱数据
export const deleteGraphData = (id) => {
  return request.delete(`/graph/${id}`)
}

// 根据科目ID删除图谱数据
export const deleteGraphDataBySubjectId = (subjectId) => {
  return request.delete(`/graph/subject/${subjectId}`)
}
